package com.wjl.picture.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wjl.picture.api.aliyunapi.model.CreateOutPaintingTaskResponse;
import com.wjl.picture.picture.model.entity.Picture;
import com.wjl.picture.picture.model.request.*;
import com.wjl.picture.picture.model.vo.PictureVO;
import com.wjl.picture.user.model.entity.User;

import java.util.List;


/**
 * @author jdd
 * @description 针对表【picture(图片)】的数据库操作Service
 * @createDate 2024-12-16 11:23:36
 */
public interface PictureService extends IService<Picture> {

    /**
     * 上传图片
     *
     * @param inputSource
     * @param pictureUploadRequest
     * @return
     */
    PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest);

    /**
     * 校验
     *
     * @param picture
     * @param add
     */
    void validPicture(Picture picture, boolean add);

    /**
     * 获取查询条件
     *
     * @param pictureQueryRequest
     * @return
     */
    LambdaQueryWrapper<Picture> getLambdaQueryWrapper(PictureQueryRequest pictureQueryRequest);

    /**
     * 获取帖子封装
     *
     * @param picture
     * @return
     */
    PictureVO getPictureVO(Picture picture);

    /**
     * 分页获取帖子封装
     *
     * @param picturePage
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage);

    /**
     * 分页查询帖子
     *
     * @param pictureQueryRequest
     * @return
     */
    Page<PictureVO> listPictureVOByPage(PictureQueryRequest pictureQueryRequest);

    /**
     * 校验删除请求
     *
     * @param ids
     * @param user
     * @return
     */
    void validDelete(List<Long> ids, User user);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    /**
     * 填充审核参数
     *
     * @param picture
     */
    void fillReviewParams(Picture picture);

    /**
     * 批量抓取和创建图片
     *
     * @param pictureUploadByBatchRequest
     * @return 成功创建的图片数
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest);

    /**
     * 校验图片权限
     *
     * @param picture
     */
    void checkPictureAuth(Picture picture);

    /**
     * 删除图片
     *
     * @param pictureId
     */
    void deletePicture(long pictureId);

    /**
     * 编辑图片
     *
     * @param pictureEditRequest
     */
    void editPicture(PictureEditRequest pictureEditRequest);


    List<PictureVO> searchPictureByColor(Long spaceId, String picColor);

    CreateOutPaintingTaskResponse createPictureOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest);
}
